package com.servlet.test; /**
 * @author : DuJiabao
 * @Date : 2021/3/27 11:43
 * @Project : java-web
 * @File : ${FILE_NAME}
 * @Desc :
 */

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebServlet(name = "RedirectServlet", value = "/RedirectServlet")
public class RedirectServlet extends HttpServlet {
  @Override
  protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    response.sendRedirect("http://www.baidu.com");
  }

  @Override
  protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    response.sendRedirect("http://www.baidu.com");
  }
}
